import request from "@/utils/request";

/**
 * 获取部门列表
 * @param {*} data
 * @returns
 */
export function getDepartment() {
  return request({
    url: "/company/department",
  });
}
/**
 * 新增部门
 */

export function addDepartments(data) {
  return request({
    url: "/company/department",
    method: "post",
    data,
  });
}
/**
 * 获取部门详情
 */
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
  });
}
/**
 * 修改部门详情
 */
export function UpDepartDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: "put",
    data,
  });
}
/**
 * 删除部门
 */
export function DeleteDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: "DELETE",
  });
}
